import request from '@/utils/request'

export function createDefect(data) {
  return request({
    url: '/defect/create',
    method: 'POST',
    data
  })
}

export function getDefects(params) {
  return request({
    url: '/defects',
    method: 'GET',
    params
  })
}

export function getDefect(id) {
  return request({
    url: `/defect/${id}`,
    method: 'GET'
  })
}

export function updateDefect(data) {
  return request({
    url: `/defect/update`,
    method: 'PUT',
    data
  })
}

export function deleteDefect(id) {
  return request({
    url: `/defect/${id}`,
    method: 'DELETE'
  })
}
